<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>~/projects/Untitled.html</title>
<meta name="Generator" content="Vim/7.3">
<meta name="plugin-version" content="vim7.3_v10">
<meta name="syntax" content="diff">
<meta name="settings" content="use_css,expand_tabs">
<style type="text/css">
<!--
pre { font-family: monospace; color: #000000; background-color: #e4e4e4; }
body { font-family: monospace; color: #000000; background-color: #e4e4e4; }
.Identifier { color: #008080; }
.Special { color: #c00000; font-weight: bold; }
.Statement { color: #af5f00; font-weight: bold; }
.Type { color: #8080ff; }
-->
</style>
</head>
<body>
<pre>
<span class="Type">--- yand001.cpp</span>
<span class="Type">+++ yand001_fixed.cpp</span>
<span class="Statement">@@ -5,12 +5,11 @@</span>
 public:
     enum FeatureType {eUnknown, eCircle, eTriangle, eSquare};

<span class="Special">-    Feature() : type(eUnknown), points(0) {    }</span>
<span class="Identifier">+    Feature() : points(0), type(eUnknown) {    }</span>

     ~Feature()
     {
<span class="Special">-        if (points)</span>
<span class="Special">-            delete points;</span>
<span class="Identifier">+            delete [] points;</span>
     }

     bool isValid()
<span class="Statement">@@ -33,7 +32,7 @@</span>
         points = new double[n];
         if (!points)
             return false;
<span class="Special">-        return fread(&amp;points, sizeof(double), n, file) == n*sizeof(double);</span>
<span class="Identifier">+        return fread(points, sizeof(double), n, file) == n*sizeof(double);</span>
     }
     void draw()
     {
<span class="Statement">@@ -42,10 +41,12 @@</span>
         case eCircle: drawCircle(points[0], points[1], points[2]); break;
         case eTriangle:    drawPoligon(points, 6); break;
         case eSquare: drawPoligon(points, 8); break;
<span class="Identifier">+        case eUnknown:</span>
<span class="Identifier">+        default: break;</span>
         }
     }

<span class="Special">-protected:</span>
<span class="Identifier">+private:</span>
     void drawCircle(double centerX, double centerY, double radius);
     void drawPoligon(double* points, int size);

</pre>
</body>
</html>
